const data = window._videoAccess.monitorSelect;

if (data && data.monitorLevel != 'root') {
    const delModals = this.pageObj.getApiWidgetsByClassName('del-modal');
    delModals.forEach(v => v.hideWidget());

    const $form = this.pageObj.getApiWidgetByAliasName('monitor_form').widgetObj;
    $form.setFormData('monitor_form', {
        viewName: data.viewName,
        viewType: data.viewType,
        projectCode: data.projectCode,
    });
    const $modalTitle = this.pageObj.getApiWidgetByAliasName('monitor-modal-title').widgetObj;
    $modalTitle._option.links.text = '编辑视图';
    $modalTitle.render();
    const modals = this.pageObj.getApiWidgetsByClassName('monitor-modal');
    modals.forEach(v => v.showWidget());
    window._videoAccess.monitorSelect = { ...window._videoAccess.monitorSelect, operate: 'edit' };
} else {
    layer.msg('请选择修改的视图');
}
